home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / syntax / psf.vim < prev    next >
Encoding:
Text File  |  2001-05-12  |  4.5 KB  |  104 lines

  1. " Vim syntax file
  2. " Language:    Software Distributor product specification file
  3. "               (POSIX 1387.2-1995).
  4. " Maintainer:    Rex Barzee <rex_barzee@hp.com>
  5. " Last change:    25 Apr 2001
  6.  
  7. if version < 600
  8.   " Remove any old syntax stuff hanging around
  9.   syn clear
  10. elseif exists("b:current_syntax")
  11.   finish
  12. endif
  13.  
  14. " Product specification files are case sensitive
  15. syn case match
  16.  
  17. syn keyword psfObject bundle category control_file depot distribution
  18. syn keyword psfObject end file fileset host installed_software media
  19. syn keyword psfObject product root subproduct vendor
  20.  
  21. syn match  psfUnquotString +[^"#     ][^#]*+ contained
  22. syn region psfQuotString   start=+"+ skip=+\\"+ end=+"+ contained
  23.  
  24. syn match  psfObjTag    "\<[-_+A-Z0-9a-z]\+\(\.[-_+A-Z0-9a-z]\+\)*" contained
  25. syn match  psfAttAbbrev ",\<\(fa\|fr\|[aclqrv]\)\(<\|>\|<=\|>=\|=\|==\)[^,]\+" contained
  26. syn match  psfObjTags   "\<[-_+A-Z0-9a-z]\+\(\.[-_+A-Z0-9a-z]\+\)*\(\s\+\<[-_+A-Z0-9a-z]\+\(\.[-_+A-Z0-9a-z]\+\)*\)*" contained
  27.  
  28. syn match  psfNumber    "\<\d\+\>" contained
  29. syn match  psfFloat     "\<\d\+\>\(\.\<\d\+\>\)*" contained
  30.  
  31. syn match  psfLongDate  "\<\d\d\d\d\d\d\d\d\d\d\d\d\.\d\d\>" contained
  32.  
  33. syn keyword psfState    available configured corrupt installed transient contained
  34. syn keyword psfPState   applied committed superseded contained
  35.  
  36. syn keyword psfBoolean  false true contained
  37.  
  38.  
  39. "Some of the attributes covered by attUnquotString and attQuotString:
  40. " architecture category_tag control_directory copyright
  41. " create_date description directory file_permissions install_source
  42. " install_type location machine_type mod_date number os_name os_release
  43. " os_version pose_as_os_name pose_as_os_release readme revision
  44. " share_link title vendor_tag
  45. syn region psfAttUnquotString matchgroup=psfAttrib start=~^\s*[^#     ]\+\s\+[^#"     ]~rs=e-1 contains=psfUnquotString,psfComment end=~$~ keepend oneline
  46.  
  47. syn region psfAttQuotString matchgroup=psfAttrib start=~^\s*[^#     ]\+\s\+"~rs=e-1 contains=psfQuotString,psfComment skip=~\\"~ matchgroup=psfQuotString end=~"~ keepend
  48.  
  49.  
  50. " These regions are defined in attempt to do syntax checking for some
  51. " of the attributes.
  52. syn region psfAttTag matchgroup=psfAttrib start="^\s*tag\s\+" contains=psfObjTag,psfComment end="$" keepend oneline
  53.  
  54. syn region psfAttSpec matchgroup=psfAttrib start="^\s*\(ancestor\|applied_patches\|applied_to\|contents\|corequisites\|exrequisites\|prerequisites\|software_spec\|supersedes\|superseded_by\)\s\+" contains=psfObjTag,psfAttAbbrev,psfComment end="$" keepend
  55.  
  56. syn region psfAttTags matchgroup=psfAttrib start="^\s*all_filesets\s\+" contains=psfObjTags,psfComment end="$" keepend
  57.  
  58. syn region psfAttNumber matchgroup=psfAttrib start="^\s*\(compressed_size\|instance_id\|media_sequence_number\|sequence_number\|size\)\s\+" contains=psfNumber,psfComment end="$" keepend oneline
  59.  
  60. syn region psfAttTime matchgroup=psfAttrib start="^\s*\(create_time\|ctime\|mod_time\|mtime\|timestamp\)\s\+" contains=psfNumber,psfComment end="$" keepend oneline
  61.  
  62. syn region psfAttFloat matchgroup=psfAttrib start="^\s*\(data_model_revision\|layout_version\)\s\+" contains=psfFloat,psfComment end="$" keepend oneline
  63.  
  64. syn region psfAttLongDate matchgroup=psfAttrib start="^\s*install_date\s\+" contains=psfLongDate,psfComment end="$" keepend oneline
  65.  
  66. syn region psfAttState matchgroup=psfAttrib start="^\s*\(state\)\s\+" contains=psfState,psfComment end="$" keepend oneline
  67.  
  68. syn region psfAttPState matchgroup=psfAttrib start="^\s*\(patch_state\)\s\+" contains=psfPState,psfComment end="$" keepend oneline
  69.  
  70. syn region psfAttBoolean matchgroup=psfAttrib start="^\s*\(is_kernel\|is_locatable\|is_patch\|is_protected\|is_reboot\|is_reference\|is_secure\|is_sparse\)\s\+" contains=psfBoolean,psfComment end="$" keepend oneline
  71.  
  72. syn match  psfComment "#.*$"
  73.  
  74.  
  75. " Define the default highlighting.
  76. " For version 5.7 and earlier: only when not done already
  77. " For version 5.8 and later: only when an item doesn't have highlighting yet
  78. if version >= 508 || !exists("did_psf_syntax_inits")
  79.   if version < 508
  80.     let did_psf_syntax_inits = 1
  81.     command -nargs=+ HiLink hi link <args>
  82.   else
  83.     command -nargs=+ HiLink hi def link <args>
  84.   endif
  85.  
  86.   HiLink psfObject       Statement
  87.   HiLink psfAttrib       Type
  88.   HiLink psfQuotString   String
  89.   HiLink psfObjTag       Identifier
  90.   HiLink psfAttAbbrev    PreProc
  91.   HiLink psfObjTags      Identifier
  92.  
  93.   HiLink psfComment      Comment
  94.  
  95.   delcommand HiLink
  96. endif
  97.  
  98. " Long descriptions and copyrights confuse the syntax highlighting, so
  99. " force vim to backup at least 100 lines before the top visible line
  100. " looking for a sync location.
  101. syn sync lines=100
  102.  
  103. let b:current_syntax = "psf"
  104.